/**
 * calculator
 *
 * @author : tzy
 * @Date : 2021-03-16
 * @Description:
 **/

package com.tang.calculator.context;

import com.tang.calculator.config.Formula;
import com.tang.calculator.symbols.OperatorSymbol;
import com.tang.calculator.symbols.Symbol;
import com.tang.calculator.symbols.ValueSymbol;
import lombok.Data;

import java.util.*;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.util.Stack;

@Data
public class CalculateContext {
    private Object obj;
    private Formula formulaVO;
    //计数器
    private List<Integer> count = new ArrayList<>();
    private String formula;
    private List<Symbol> symbolList = new LinkedList<>();
    private Stack<ValueSymbol> valueStack = new Stack<>();
    private Stack<OperatorSymbol> operatorStack = new Stack<>();
    private Map<String, Object> resource = new HashMap<>();
    private List<ValueSymbol> tempValues = new LinkedList<>();

    public CalculateContext() {
    }

    public CalculateContext(Formula formulaVO) {
        this.formulaVO = formulaVO;
        this.formula = formulaVO.getFormula();
    }
}
